#define _CRT_SECURE_NO_WARNINGS


#include <stdio.h>

int main()
{
    char arr[1000] = { 0 };
    int n = 0;
    scanf("%s", arr);
    scanf("%d", &n);

    for (int i = 0; i < n; i++)
    {
        printf("%c", arr[i]);
    }

    return 0;
}